import instance from '../axios_config'

const getusers = async (url: string) => {
  const users = await instance.get(url)
  return users.data
}

const adduser = async (url: string, userdata: any) => {
  const data = await instance.post(url, userdata)
  return data.data
}

const deleteuser = async (url: string) => {
  const data = await instance.delete(url)
  return data.data
}

const edituser = async (url: string, userdata: any) => {
  const data = await instance.patch(url, userdata)
  return data.data
}

const importUser = async (url: string, userdata: any) => {
  const data = await instance.post(url, userdata)
  return data.data
}
export default {
  getusers,
  adduser,
  deleteuser,
  edituser,
  importUser
}
